package com.qingcloud.base.api.remote.datafusion.factory;
import com.qingcloud.base.api.remote.datafusion.DatafusionApi;
import com.qingcloud.base.api.remote.datafusion.fallback.DatafusionApiFallback;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class DatafusionApiFallbackFactory implements FallbackFactory<DatafusionApi> {
    @Override
    public DatafusionApi create(Throwable throwable) {
        DatafusionApiFallback fallback = new DatafusionApiFallback();
        fallback.setCause(throwable);
        return fallback;
    }
}
